﻿<Windows:BookvarToolWindow
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:aw="clr-namespace:Assergs.Windows;assembly=Assergs.Windows"
	xmlns:converters="clr-namespace:Bookvar.UI.Converters;assembly=Bookvar.UI"
	xmlns:commands="clr-namespace:Bookvar.UI.Commands;assembly=Bookvar.UI"
	xmlns:Windows="clr-namespace:BookvarWpf.Windows"
    xmlns:r="clr-namespace:Bookvar.UI.Localization;assembly=Bookvar.UI"
	x:Class="BookvarWpf.Windows.AddAttachmentsWindow"
	Header="{r:Resources AddAttachmentsHeaderText}"
	Icon="pack://application:,,,/BookvarWPF;component/Resources/Icons/16x16/Paperclip.png"
	Style="{DynamicResource {x:Type aw:ToolWindow}}"
	Background="{StaticResource ListBackground}"
	Width="400" Height="264.63"
	>
    <Windows:BookvarToolWindow.InputBindings>
        <KeyBinding Command="aw:ToolWindow.CloseCommand" Key="Escape" />
    </Windows:BookvarToolWindow.InputBindings>
    <Grid>
		<Grid.Resources>
			<converters:NullToBooleanConverter x:Key="nullToBool" />
            <Style TargetType="Button" x:Key="attachmentButton">
                <Setter Property="HorizontalAlignment" Value="Stretch"></Setter>
                <Setter Property="VerticalAlignment" Value="Center"></Setter>
                <Setter Property="Height" Value="22"></Setter>
                <Setter Property="Margin" Value="2"></Setter>
                <Setter Property="MinWidth" Value="80"></Setter>
                <Setter Property="BorderBrush" Value="#FF536B88"></Setter>
                <Setter Property="Background" Value="{StaticResource BlueButtonStyleBrush}"></Setter>
            </Style>
        </Grid.Resources>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.34*"/>
			<ColumnDefinition Width="0.66*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="0.382*"/>
			<RowDefinition Height="0.039*"/>
			<RowDefinition Height="0.579*"/>
		</Grid.RowDefinitions>
		<StackPanel  Grid.ColumnSpan="2" Grid.RowSpan="3" >
			<TextBlock Width="Auto" Height="24" Text="{r:Resources AddAttachmentsAttachmentsText}" TextWrapping="Wrap" TextAlignment="Left" FontFamily="Verdana" FontSize="18" Foreground="#FFFFFFFF"
                 HorizontalAlignment="Left" Margin="10,6,15,6" VerticalAlignment="Center"/>
			<StackPanel Orientation="Horizontal">
				<Border HorizontalAlignment="Left" VerticalAlignment="Center" BorderBrush="#FF85A7DB" BorderThickness="1,1,1,1"
				 Grid.Row="0" Grid.Column="1" Margin="10,2,15,6"
			CornerRadius="5,5,5,5" Background="#FFF0F7FF">
					<ListBox x:Name="fileList" DisplayMemberPath="FileName" Width="240" Height="125" Background="Transparent"
							 HorizontalAlignment="Left" Margin="2,2,2,2" BorderThickness="0,0,0,0" VerticalAlignment="Top" />
				</Border>
				<StackPanel Orientation="Vertical" FocusManager.IsFocusScope="True">
                    <Button Click="OnSaveAsClicked" Content="{r:Resources AddAttachmentsSaveAsText}" Style="{StaticResource attachmentButton}"
                        Command="commands:BookvarCommands.SaveAttachment" />
                    <Button Click="OnAddClicked" Content="{r:Resources AddAttachmentsAddText}"  Style="{StaticResource attachmentButton}"
                        Command="commands:BookvarCommands.AddAttachment" />
                    <Button Content="{r:Resources AddAttachmentsRenameText}" Style="{StaticResource attachmentButton}"
                      IsEnabled="false" /> <!-- rename is not implemented yet -->
                    <Button Content="{r:Resources AddAttachmentsRemoveText}" Style="{StaticResource attachmentButton}"
                      Command="commands:BookvarCommands.DeleteAttachment" />
                    <Button Command="aw:ToolWindow.CloseCommand" Content="{r:Resources AddAttachmentsCloseText}" Style="{StaticResource attachmentButton}" />
				</StackPanel>
			</StackPanel>
		</StackPanel>
	</Grid>
</Windows:BookvarToolWindow>
